package cp3120.ucm;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

/**
 * An Adaptor that allows Use Cases to implement an Action Listener Interface.
 * @author Adam Scarr
 * @since r1
 */
public class UC2ALAdapter implements ActionListener {
    private UCController uc;

    /**
     * Class Constructor
     * @param uc   The use case to use.
     */
    public UC2ALAdapter(UCController uc) {
        this.uc = uc;
    }

    /**
     * The call point for the action listener, Which gets passed through to the use case.
     * @param actionEvent   An event passed to us by swing.
     */
    public void actionPerformed(ActionEvent actionEvent) {
        new Thread(uc).start();
    }
}
